<div class="workAdd">
    <app-head-title title="报工添加"></app-head-title>
    <div class="workAdd_list" [hidden]="submitted" id="dateDemo">
        <form #workaddForm="ngForm" (ngSubmit)="ngSubmit($event)">
            <ul class="border-top">
                <li class="employeeName border-bottom">
                    <label for="employeeName">员工姓名</label>
                    <span class="employeeNameAdd">
                        <!-- {{workadd.employeename}} -->
                        {{plpName}}
                    </span>
                </li>
                <li class="employeeNumber border-bottom">
                    <label for="employeeNumber">员工编号</label>
                    <span class="employeeNameAdd">
                        <!-- {{workadd.employeeNumber}} -->
                        {{employId}}
                    </span>
                </li>
            </ul>
            <ul class="border-bottom-ddd">
                <li class="employeeDate border-bottom">
                    <label for="employeeDate">报工日期</label>
                    <i class="icon_date"></i>
                    <div>
                        <input type="text" id="employeeDate" [(ngModel)]="workadd.WorkDate" name="WorkDate" #WorkDate="ngModel" required placeholder="最早日期不能超过前7天" readonly (focus)="reset()">
                    </div>
                    <!-- <form #myForm="ngForm" novalidate>
                        <my-date-picker name="mydate" [options]="myDatePickerOptions" [(ngModel)]="model" required></my-date-picker>
                    </form> -->
                </li>
                <li class="projectNumber border-bottom">
                    <label for="projectNumber"><i class="paddingLeft">编</i><i class="paddingRight">号</i></label>
                    <i class="icon_search" (click)="iconSearch($event,1)"></i>
                    <div>
                        <input type="text" id="projectNumber" [(ngModel)]="workadd.ProId" name="ProId" #ProId="ngModel" required (keyup)="projectIdSearch(ProId.value,$event)" (blur) = "projectNumberBlur()" oninput="this.value=this.value.replace(/^[^0-9]*$/,'');" autocomplete="off" (focus)="reset()" >
                    </div>
                    <ul class="projectId_img" name="flag" type="String" id="projectIdSearch" *ngIf="projectIdFlag">
                        <li class="border-bottom" *ngFor="let item of dataList.body.ProInfo" (click)="addProjectId(item)">{{item.ProId}}</li>
                    </ul>
                </li>
                <div [hidden]="ProId.valid || ProId.pristine" class="alert alert-danger">
                    项目编号不能为空
                </div>
                <li class="projectName border-bottom">
                    <label for="projectName"><i class="paddingLeft">名</i><i class="paddingRight">称</i></label>
                    <i class="icon_search" (click)="iconSearch($event,2)"></i>
                    <div>
                        <input type="text" id="projectName" [(ngModel)]="workadd.ProName" name="ProName" #ProName="ngModel" required (keyup)="keyChangeColor(ProName.value,$event)" (blur) = "pronameBlur()" autocomplete="off" (focus)="reset()">
                    </div>
                    <ul class="projectName_img" name="flag" type="String" id="projectNameSearch" *ngIf="projectNameFlag">
                        <li class="border-bottom" *ngFor="let item of dataList.body.ProInfo" #nameSearchList (click)="addProjectName(item)">{{item.ProName}}</li>
                    </ul>
                </li>
                <div [hidden]="ProName.valid || ProName.pristine" class="alert alert-danger">
                    项目名称不能为空
                </div>
                <li class="proType border-bottom">
                    <label for=""><i class="paddingLeft">类</i><i class="paddingRight">型</i></label>
                    <div *ngIf="proType === '2'"><span>项目</span></div>
                    <div *ngIf="proType === '1'"><span>机会</span></div>
                </li>
                <li class="workType border-bottom">
                    <label for="WorkType fl">工作类型</label>
                    <input type="hidden" [(ngModel)]="workadd.WorkType" name="WorkType" #WorkType="ngModel" required>
                    <p class="fr ">
                        <input (click)="choiceWorkType($event) " [ngClass]="{active:  iswork} " type="text" value="工作" onfocus="this.blur()">
                        <!-- <input (click)="choiceWorkType($event) " [ngClass]="{active: isAddWork} " type="text" value="加班" onfocus="this.blur()"> -->
                        <input (click)="choiceWorkType($event) " [ngClass]="{active: isleave} " type="text" value="请假" onfocus="this.blur()">
                    </p>
                </li>
                <div [hidden]="WorkType.valid || WorkType.pristine" class="alert alert-danger">
                    工作类型不能为空
                </div>
                <li class="workContent border-bottom">
                    <label for="WorkContent">工作内容</label>
                    <div>
                        <textarea name="" id="WorkContent" [(ngModel)]="workadd.WorkContent" name="WorkContent" #WorkContent="ngModel" required autocomplete="off" (focus)="reset()"></textarea>
                    </div>
                </li>
                <div [hidden]="WorkContent.valid || WorkContent.pristine" class="alert alert-danger">
                    工作内容不能为空
                </div>
                <li class="consumptionTime border-bottom">
                    <label for="consumptionTime">消耗工时</label><input type="text" id="consumptionTime" [(ngModel)]="workadd.ConsumeTime" name="ConsumeTime" #ConsumeTime="ngModel" oninput="this.value=this.value.replace(/^[^1-9][^0-9]*$/,'');" required autocomplete="off" (focus)="reset()"> <span>小时</span>
                </li>
                <div [hidden]="ConsumeTime.valid || ConsumeTime.pristine" class="alert alert-danger" >
                    消耗工时不能为空
                </div>
            </ul>
            <div class="rejectReson">{{rejectReson}}</div>
            <button type="submit" class="sureBtn" [disabled]="!workaddForm.form.valid " #submitBtn id="submitBtn" [ngClass]="{active: changeColor} " oninput="this.value=this.value.replace(/^[^1-9][^0-9]*$/,'');if(parseFloat(this.value)>99999)this.value=99999;">确定</button>
        </form>
    </div>
</div>